package com.louzhu.gulimall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 视图控制器
 */
@Configuration
public class GulimallWebConfig implements WebMvcConfigurer {


    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        /**
         * 跳转登录页
        @GetMapping("/login.html")
        public String login(){
            return "login";
        }
        */
        registry.addViewController("/login.html").setViewName("login");
        /**
         * 跳转注册页
        @GetMapping("/reg.html")
        public String reg(){
            return "reg";
        }
         */
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
